<?	/* @var $entryForm EntryFormForBackend */	?>
<?	/* @var $entry Entry */	?>

<?php use_helper("jQuery"); ?>

<?
if ($entryForm->getObject()->isNew()){
	$routeName="entries_create";
}else{
	$routeName="entries_update";
}
?>

<form action="<?= url_for($routeName, $entryForm->getObject()) ?>" method="POST">
	<?=	$entryForm["_csrf_token"]->render() ?>

	<? if (!$entryForm->getObject()->isNew()):// REST! ?>
		<input type="hidden" name="sf_method" value="PUT" />
		<?=	$entryForm["id"]->render() ?>
	<? endif ?>

	<?	if ($section!=null):	?>
		<?=	$entryForm["section_id"]->render(array("value" => $section->getId())) ?>
	<?	endif ?>

	<?=	$entryForm->renderGlobalErrors() ?>

	<?=	$entryForm["name"]->renderLabel()	?>:
	<?=	$entryForm["name"]->render()	?>
	<br/>
	<?=	$entryForm["content"]->renderLabel()	?>:<br/>
	<?=	$entryForm["content"]->render()	?>
	<br/>
	<?=	$entryForm["tags"]->renderLabel()	?>:
	<?=	$entryForm["tags"]->render(array("class" => "tag-input", "autocomplete" => "off"))	?>
	<br/>
	<?=	$entryForm["datetime"]->renderLabel()	?>:
	<?=	$entryForm["datetime"]->render()	?>
	<br/>
	<?=	$entryForm["published"]->renderLabel()	?>:
	<?=	$entryForm["published"]->render()	?>
	<br/>
	<input type="submit" value="Ok" />
	<?= jq_submit_to_remote("name", "AJAX save", array("url" => url_for($routeName, $entryForm->getObject()))) ?>

</form>
